home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / memos.zip / ERRCODE.PRG < prev    next >
Text File  |  1992-09-08  |  6KB  |  140 lines

  1. /****
  2. *   Program Name : ERRCODE.PRG                                                         
  3. *
  4. *   Authors      : Barry Ehret, Michael Abadjiev
  5. *   Last Update  : 05/29/92                                                       
  6. *
  7. *   Purpose      : Return the error message for a given error code.
  8. *   Language     : Clipper 5.01a
  9. *
  10. *   Functions    :
  11. *       GetDosErr() --> CHARACTER
  12. ****/                
  13.  
  14.  
  15. #define PROGRAMMER_ERROR  1000
  16.  
  17.  
  18. STATIC DosErr := {} 
  19.  
  20.  
  21. /****
  22. *   Function GetDosErr() --> CHARACTER
  23. *
  24. *   Purpose: Given a DOS error code, return the corresponding
  25. *            text error message. Note there are also user defined
  26. *            error codes in this list.
  27. ****/
  28.  
  29. FUNCTION GetDosErr(arg)
  30.  
  31.     LOCAL nPtr, cMsg := "Unknown Error Code : 999"
  32.  
  33.     IF valtype(arg) <> "N"                           
  34.         tone(440,1) ; tone(880,1)
  35.         alert("Bad Parameter Function GetDosErr(arg)")
  36.         RETURN GetDosErr(PROGRAMMER_ERROR)
  37.     ENDIF
  38.  
  39.     IF len(DosErr) == 0     
  40.         ErrCodeArray()
  41.     ENDIF                                
  42.  
  43.     nPtr := ascan(DosErr,{|x| x[1] = arg})
  44.  
  45.     IF nPtr > 0
  46.         cMsg := DosErr[nPtr,2]
  47.     ENDIF
  48.  
  49. RETURN cMsg
  50.  
  51.  
  52. ****/
  53. *   Function ErrCodeArray() --> NIL
  54. *                             
  55. *   Note: DosErr[..] is a static array containing error messages
  56. *         corresponding to some of the DOS error numbers.
  57. *         Messages may be edited or changed to null strings, if desired.
  58. ****/                                 
  59.  
  60. STATIC FUNCTION ErrCodeArray()
  61.  
  62.     DosErr := array(71)
  63.  
  64.     DosErr[001] := {001, "Invalid function number"               }
  65.     DosErr[002] := {002, "File not found"                        }
  66.     DosErr[003] := {003, "Path not found"                        }
  67.     DosErr[004] := {004, "Too many open files"                   }
  68.     DosErr[005] := {005, "Access denied"                         }
  69.     DosErr[006] := {006, "Invalid handle"                        }
  70.     DosErr[007] := {007, "Memory"                                }
  71.     DosErr[008] := {008, "Insufficient memory"                   }
  72.     DosErr[009] := {009, "Memory"                                }
  73.     DosErr[010] := {010, "Invalid environment"                   }
  74.     DosErr[011] := {011, "Invalid format"                        }
  75.     DosErr[012] := {012, "Invalid access code"                   }
  76.     DosErr[013] := {013, "Invalid data"                          }
  77.     DosErr[014] := {015, "Invalid drive"                         }
  78.     DosErr[015] := {016, "Cannot remove directory"               }
  79.     DosErr[016] := {017, "Not same device"                       }
  80.     DosErr[017] := {018, "No more files"                         }
  81.     DosErr[018] := {019, "Write-protect"                         }
  82.     DosErr[019] := {020, "Unknown unit"                          }
  83.     DosErr[020] := {021, "Drive not ready"                       }
  84.     DosErr[021] := {022,  "Unknown command"                      }
  85.     DosErr[022] := {023,  "Data error (CRC)"                     }
  86.     DosErr[023] := {024,  "Bad request"                          }
  87.     DosErr[024] := {025,  "Seek error"                           }
  88.     DosErr[025] := {026,  "Unknown media type"                   }
  89.     DosErr[026] := {027,  "Sector not found"                     }
  90.     DosErr[027] := {028,  "Printer out of paper"                 }
  91.     DosErr[028] := {029,  "Write fault"                          }
  92.     DosErr[029] := {030,  "Read fault"                           }
  93.     DosErr[030] := {031,  "General failure"                      }
  94.     DosErr[031] := {032,  "Sharing violation"                    }
  95.     DosErr[032] := {033,  "Lock violation"                       }
  96.     DosErr[033] := {034,  "Invalid disk change"                  }
  97.     DosErr[034] := {035,  "FCB unavailable"                      }
  98.     DosErr[035] := {036,  "Sharing buffer overflow"              }
  99.     DosErr[036] := {050,  "Network request not supported"        }
  100.     DosErr[037] := {051,  "Remote not listening"                 }
  101.     DosErr[038] := {052,  "Duplicate name on network"            }
  102.     DosErr[039] := {053,  "Network name not found"               }
  103.     DosErr[040] := {054,  "Network busy"                         }
  104.     DosErr[041] := {055,  "Network device no longer exists"      }
  105.     DosErr[042] := {056,  "Network BIOS command limit exceeded"  }
  106.     DosErr[043] := {057,  "Network adapter hardware error"       }
  107.     DosErr[044] := {058,  "Incorrect response from network"      }
  108.     DosErr[045] := {059,  "Unexpected network error"             }
  109.     DosErr[046] := {060,  "Incompatible remote adapter"          }
  110.     DosErr[047] := {061,  "Print queue full"                     }
  111.     DosErr[048] := {062,  "Not enough space for print file"      }
  112.     DosErr[049] := {063,  "Print file deleted"                   }
  113.     DosErr[050] := {064,  "Network name deleted"                 }
  114.     DosErr[051] := {065,  "Access denied"                        }
  115.     DosErr[052] := {066,  "Network device type incorrect"        }
  116.     DosErr[053] := {067,  "Network name not found"               }
  117.     DosErr[054] := {068,  "Network name limit exceeded"          }
  118.     DosErr[055] := {069,  "Network BIOS session limit exceeded"  }
  119.     DosErr[056] := {070,  "Temporarily paused"                   }
  120.     DosErr[057] := {071,  "Network request not accepted"         }
  121.     DosErr[058] := {072,  "Print or disk redirection paused"     }
  122.     DosErr[059] := {080,  "File already exists"                  }
  123.     DosErr[060] := {082,  "Cannot make directory entry"          }
  124.     DosErr[061] := {083,  "Fail on INT 24H"                      }
  125.     DosErr[062] := {084,  "Too many redirections"                }
  126.     DosErr[063] := {085,  "Duplicate redirection"                }
  127.     DosErr[064] := {087,  "Invalid parameter"                    }
  128.     DosErr[065] := {088,  "Network device fault"                 }
  129.     DosErr[066] := {100,  "Corupted DBF file"                    }
  130.     DosErr[067] := {101,  "Corupted NTX File"                    }
  131.     DosErr[068] := {102,  "Missing or corupted DBT File"         }
  132.     DosErr[069] := {103,  "Wrong index expression"               }
  133.     DosErr[070] := {500,  " Invalid password !"                  }
  134.     DosErr[071] := {1000, "Program ERROR - call SYSTEMS"         }
  135.                         
  136. RETURN nil
  137.  
  138.  
  139. **** EOF: errcode.prg
  140.